<?php

use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;

class CreateLaravelExtendAuthUsersTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::dropIfExists('users');
        Schema::create('users', function (Blueprint $table) {
            $table->string('id',36)->primary();
            $table->string('account')->unique()->comment('账号');
            $table->string('password')->comment('密码');
            $table->string('name')->nullable()->unique()->comment('姓名,昵称');
            $table->string('mobile',20)->nullable()->unique()->comment('手机号');
            $table->string('email')->nullable()->unique()->comment('邮箱');
            $table->string('picture')->default('')->comment('头像');
            $table->string('sex',6)->default('保密')->index()->comment('性别:男,女,保密');
            $table->date('date_of_birth')->nullable()->index()->comment('生日');
            $table->string('address')->default('')->comment('地址');
            $table->string('lang_code',10)->default('')->index()->comment('语言');
            $table->dateTime('lock_to')->nullable()->comment('锁定时间');
            $table->string('last_login_platform')->default('')->index()->comment('最后登录平台');
            $table->string('last_login_source')->default('')->comment('最后登录标识');
            $table->string('last_login_ip')->default('')->comment('最后登录IP');
            $table->dateTime('last_login_time')->nullable()->comment('最后登录时间');
            $table->text('summary')->nullable()->comment('简介');
            $table->string('reset_password_code_id',36)->default('')->comment('重置密码验证ID');
            $table->rememberToken();
            $table->dateTime('created_at')->nullable();
            $table->dateTime('updated_at')->nullable();
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::dropIfExists('users');
    }
}
